try {
  //删除错误文字
  let errorText = document.body.childNodes[0];
  if (errorText.data == '[object Object]') {
    document.body.removeChild(errorText);
  }
} catch (error) {}

//nav透明
window.onload = function () {
  if (document.documentElement.clientWidth > 768) {
    let navbar = document.querySelector('header.navbar');
    let htmlHeight = document.documentElement.clientHeight / 2;
    let links = document.querySelector('header.navbar .links');

    addEventListener('scroll', function () {
      if (document.documentElement.scrollTop > htmlHeight) {
        if (document.documentElement.classList.contains('dark')) {
          navbar.style.background = 'rgba(0,0,0,.61)';
        } else {
          navbar.style.background = 'rgba(255,255,255,.61)';
        }
      } else {
        navbar.style.background = links.style.background = `transparent`;
      }
    });
    let centerDiv = document.querySelector(
      '#app > div.theme-container.no-sidebar > div > div:nth-child(3) > div:nth-child(5) > div.home-blog > div.hero > div'
    );
    centerDiv.appendChild(ulNav);
    // 关于图标导航
    let ulNav = document.createElement('ul');
    ulNav.classList.add('myNav');
    ulNav.innerHTML = `<li class="dropdown-item"><!----> <a href="https://github.com/dselegent" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont reco-github"></i></a></li><li class="dropdown-item"><!----> <a href="http://wpa.qq.com/msgrd?v=3&amp;uin=1799661558&amp;site=qq&amp;menu=yes" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont reco-qq"></i></a></li><li class="dropdown-item"><!----> <a href="https://space.bilibili.com/95443509" target="_blank" rel="noopener noreferrer" class="nav-link external"><i class="iconfont reco-bilibili"></i></a></li>`;
  }
};
